<!--  -->
<template>
  <el-container>
    <el-main>
      <div class="mv">
        <ul>
          <li v-for="(item, index) in mvs" :key="index">
            <div @click="toDetail(item.id)" class="img">
              <img :src="item.imgurl" alt="" />
            </div>
            <div class="title">{{ item.name }}</div>
          </li>
        </ul>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import { getSingerMv } from "util/findMusic.js";
export default {
  name: "",
  data() {
    return {
      currentId: this.$route.params.id,
      mvs: [],
    };
  },
  created() {
    this.getSingerMv();
  },
  methods: {
    async getSingerMv() {
      let {
        data: { mvs },
      } = await getSingerMv(this.currentId);
      this.mvs = mvs;
      // console.log(this.mvs);
    },
    toDetail(id) {
      this.$router.push("/mvDetail/" + id);
    },
  },
};
</script>

<style scoped>
.mv {
  margin-left: 20px;
}
.mv ul {
  display: flex;
  flex-wrap: wrap;
}
.mv ul li {
  padding: 0 1px 0 10px;
  margin-right: 45px;
  /* margin-right: 40px; */
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.mv ul li .img {
  background: #ddd;
  width: 250px;
  height: 130px;
  margin-bottom: 10px;
}
.mv ul li .img img {
  border-radius: 5px;
  width: 100%;
  height: 100%;
}
.mv ul li .title {
  width: 250px;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.mv ul li span {
  font-size: 12px;
  color: rgb(141, 135, 135);
}
</style>